const http = uni.$u.http
/**
 * START企小蛙工资条API
 */
/**
 * 修改密码
 */
export const changePassword = (data) => http.get('/api/salary/changePassword' + data)
//提交异议/api
export const updateSave = (data) => http.post('/api/salary/updateSave', data)
//ByID查询工资条
export const BySalaryId = (data) => http.get('/api/salary/getById?id=' + data)
//查询手机号码对应是否有工资条
export const checkeMployeesPhone = (data) => http.get('/api/salary/loginPhone' + data)
//查询手机号码+月份查询工资条
export const nopagelist = (data) => http.post('/api/salary/nopagelist', data)
/**
 * END企小蛙工资条API
 */

/**
 * 登录模块
 */
//获取验证码静态验证码
export const captchaImage = (data) => http.get('/captchaImage', data)
// 账号密码登录(和后台相同的账号)
export const upLogin = (params, config = {}) => http.post('/login', params, config)
//获取微信小程序绑定的手机号
export const getPhoneNumber = (params, config = {}) => http.post('/auth/wechat/getPhoneNumber', params, config)
//微信手机号授权登录
export const phoneLogin = (params, config = {}) => http.post('/phoneLogin', params, config)
///微信小程序授权登录 /vxAppletLogin
export const vxAppletLogin = (params, config = {}) => http.post('/vxAppletLogin', params, config)

export const vxGZHAppletLogin = (config = {}) => http.get('/auth/wechat/authorizeUrl', config)

//获取用户信息
export const getInfo = (data) => http.get('/getInfo', data)
//获取验证码动态验证码（手机号验证码）
export const getCheckCode = (params, config = {}) => http.post('/common/code/getCheckCode', params, config)
// 手机号验证码登录 【/phoneCheckCodeLogin】
export const phoneCheckCodeLogin = (params, config = {}) => http.post('/phoneCheckCodeLogin', params, config)


//======================WIFI开始===============================
// WIFI申请

export const MakeWIFI = (params, config = {}) => http.post('/wifi/make', params, config)

export const userWifiList = () => http.get('/wifi/make/userWifiList')

//======================智能门锁结束===============================

// phoneLogin

//==========================年级 =》班级===》学生信息=====================================================

//获取学校
export const getSchoolList = (data) => http.get('/school/crud/getSchoolList', data)
//获取年级
// /school/grade/getGradeList?schoolId= 
// export const getGradeList = (data) => http.get('/school/grade/getGradeList', data)
export const getGradeList = (data) => http.get('/school/grade/getGradeList?schoolId= ' + data)
//获取班级  /school/class/getClassList?gradeId=
export const getClassList = (data) => http.get('/school/class/getClassList?gradeId=' + data)

//获取学生列表
export const getStudent = (data) => http.get('/school/students/getStudentList?classId=' + data)

//获取家长绑定学生列表
export const getStuNameList = (data) => http.get('/school/relevancy/getStuNameList', data)
//获取学生进出列表
export const getStuRecordListByStuId = (data) => http.get('/school/relevancy/getStuRecordListByStuId?studentId=' + data)
//获取WIFI
// export const mealList = () => http.get('/wifi/meal/mealList')
export const mealList = () => http.get('/wifi/meal/list')
//获取wx支付商户号
// export const mealList = () => http.get('/wifi/meal/mealList')
export const createOrderById = (params, config = {}) => http.post('/common/order/createOrderById', params, config)
// 获取支付订单列表
// export const getOrderList = (data) => http.get('/common/order/list?userId=' + data)
// 获取支付订单列表
export const getOrderList = (data) => http.get('/common/order/getOrderListByUserId')
// /common/order/getOrderListByUserId

export const getLogInfo = (data) => http.get('/mqtt/online/getInfo?id='+data)

//家长绑定学生
export const saveBind = (params, config = {}) => http.post('/school/relevancy/saveBind', params, config)
// 获取会员到期时间
export const getMembershipByUserId = (data) => http.get('/order/membership/getMembershipByUserId')

//更新学生信息
export const upstudents = (params, config = {}) => http.post('/school/students/update', params, config)

// ===============================人脸闸机结束=============================================================
// ==============================接待宿舍================================
//入住登记
export const dormClient = (params, config = {}) => http.post('/dorm/client', params, config)

//分配房间
export const infoAllocateRoom = (data) => http.get('/cashier/infoAllocateRoom', data)
//自动分配 /dorm/client/allotRoom
export const allotRoom = (data) => http.get('/dorm/client/allotRoomTel', data)
//选择房间  /cashier/infoLeisureRoom
export const infoLeisureRoom = (data) => http.get('/cashier/infoLeisureRoom', data)
//根据楼栋 查询 楼层和房间的列表【目前在房间绑定设备的地方需要用】
export const getRoomList = (data) => http.get('/dorm/room/getRoomList', data)
//获取房间信息（查看用户是否登记，是否分配房间，分配房间了的可以开门）
export const getClientInfo = (data) => http.get('/dorm/client/getClientInfo', data)
//手动分配房间
export const checkIn = (params, config = {}) => http.post('/cashier/checkIn', params, config)
//获取获取房间列表
export const getClientCheckRecord = (data) => http.get('/dorm/client/getClientCheckRecord', data)


// ==============================接待宿舍================================

//======================智能门锁开始===============================
// 初始化门锁信息
export const zslfInsertDoorLock = (params, config = {}) => http.post('/zslf/api/bind', params, config)

//根据房间id获取设备信息
export const roomDeviceInfo = (data) => http.get('/zslf/api/roomDeviceInfo', data)
// 设置门锁密码信息
export const setLockPwd = (params, config = {}) => http.post('/zslf/updatePasswordByMac', params, config)
// 初始化蓝牙设备
export const intLock = (lockMac) => http.get('/zslf/deleteDeviceByMac', lockMac)


//======================智能门锁结束===============================

//======================预约=====================================
//提交办理校园卡预约
export const transactPost = (params, config = {}) => http.post('/make/transact', params, config)
export const getStudentList = (data) => http.get('/school/students/getStudentList', data)

//获取随机码  /random/code/getRandomCode
export const getRandomCode = (data) => http.get('/random/code/getRandomCode', data)
//验证随机码
export const checkRandomCode = (data) => http.get('/random/code/checkRandomCode', data)